.486p
.model flat
.code

        include map00.h
        include empty.h
        include file.h
        include ppu.h
        include data.h
        include equates.h

        public mapperinit66
;----------------------------------------------------------------------------
mapperinit66:;          gumshoe, dragonball
;----------------------------------------------------------------------------
        xor al,al
        call map89ABCDEF

        mov eax,offset w8000            ;redirect rom writes
        mov [write_tbl+4*4],eax
        mov [write_tbl+5*4],eax
        mov [write_tbl+6*4],eax
        mov [write_tbl+7*4],eax

        test [cartflags],MIRROR         ;set mirror
        call mirror2H

        ret
;----------------------------------------------------------------------------
w8000:
;----------------------------------------------------------------------------
	push eax
	shr eax,4
	and eax,3
        call map89ABCDEF
        call flush

	pop eax
	and eax,3
	shl eax,15
	and eax,[chrmask]
	add eax,[chr_ptr]

	mov [chr_map+00h],eax
	add eax,1000h
	mov [chr_map+04h],eax
	add eax,1000h
	mov [chr_map+08h],eax
	add eax,1000h
	mov [chr_map+0Ch],eax
	add eax,1000h
	mov [chr_map+10h],eax
	add eax,1000h
	mov [chr_map+14h],eax
	add eax,1000h
	mov [chr_map+18h],eax
	add eax,1000h
	mov [chr_map+1Ch],eax

	jmp newchrmap
;----------------------------------------------------------------------------
        end
